#include "mainwindow.h"
#include "ui_mainwindow.h"

#include "akWorker.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    wk = 0;
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_pbst_clicked()
{
    if (wk)
    {
        delete wk;
        wk = 0;
        ui->pbst->setText(QString("启动"));
    }
    else
    {
        wk = new akWorker;

        wk->start();

        ui->pbst->setText(QString("停止"));
    }
}
